#ifndef WORDCOUNTER_H_
#define WORDCOUNTER_H_

#include <map>
#include <string>
#include "WellSizedVector.h"
#include <boost/tr1/memory.hpp>
#include <list>
#include "MapsDisk.h"

//struct twoInts{
//	uint id;
//	uint quantity;
//};

class Aurelio {
private:
	Aurelio();
	unsigned long long getNewWordHash(std::string &/*, bool debug*/);
	
public:
	static std::tr1::shared_ptr<Aurelio> getInstance() {return aurelioBuarque;}
	std::list <unsigned long long> * updateDictionarySizes (std::string, uint id/*, bool debug*/);
	void printDictionary();
	void printFullDictionary();
	void printFullDictionaryInfo();
	void clearDictionary();
	void initializeVectors();
	void updateDictionary(uint, std::list<unsigned long long> *);
	void saveAndClear();
	

private:
    static std::tr1::shared_ptr<Aurelio> aurelioBuarque;
    uint numCollisions;
    MapsDisk mapsDisk;
	std::map<unsigned long long, WellSizedVector> wordDictionary;
	std::map<unsigned long long, std::map<uint, uint> > positionsSizeMap;
	
	std::string delimiters;
};

#endif /*WORDCOUNTER_H_*/
